Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: accept prop for heading level (#1751) #1865

Merged
merged 3 commits into from
Jan 7, 2022

Conversation

rswerve
Copy link
Contributor

@rswerve rswerve commented Jan 7, 2022

Summary

The heading level in the StepIndicator currently defaults to h4, and the inability to change this causes an accessibility issue when used in a document that doesn't include h1, h2, and h3. We should be able to specify the desired heading level.

This PR introduces a headingLevel prop to the StepIndicator, so that any given instance can have any valid heading level.

In order to make this a non-breaking change, if no heading level is specified, the component maintains the current behavior of defaulting to h4.

Related Issues or PRs

Closes #1751

How To Test

In Storybook, select the Heading variant of the StepIndicator, and inspect the markup to see that it accords with the screenshot below.

Review new unit tests.

Screenshots (optional)

image

haworku
haworku previously approved these changes Jan 7, 2022
Copy link
Contributor

@haworku haworku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

suzubara
suzubara previously approved these changes Jan 7, 2022
…es.tsx


rename Storybook story

Co-authored-by: haworku <haworku@users.noreply.github.com>
@rswerve rswerve merged commit 464756f into main Jan 7, 2022
@rswerve rswerve deleted the ma-stepindicator-header-props-1751 branch January 7, 2022 19:39
@rswerve rswerve mentioned this pull request Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fix] StepIndicator should handle custom heading levels to allow semantic html
4 participants